package data_structure;

public class leetcode_0387 {
    public int firstUniqChar(String s) {
        char[] list = s.toCharArray();
        int len = list.length;
        int [] num=new int[26];
        for(int i=0;i<len;++i){
            num[list[i]-'a']+=1;
        }
        for(int i=0;i<len;++i){
            if(num[list[i]-'a']==1) return i;
        }
        return -1;
    }
}
